

import x from '~/plugins/cookie.js'
export const actions = {
    nuxtServerInit({ commit }, { req }) {

 
        let { cookie } = req.headers
 
        if (cookie) {
            let cookieJson = x.toJSON(cookie);
            if (cookieJson.current) {
                let data = JSON.parse(cookieJson.current);
                data.name=decodeURIComponent(data.name);
                commit("user/current",data);
            }
        }
    }
}